
#include <stdio.h>
#include "lpc11xx.h"
#include "clkconfig.h"
#include "gpio.h"
#include "uart.h"
#include "ssp.h"

#include "rom_drivers.h"

#include "oled2864.h" 

#include "tools.h"
#include "spi_uart.h"
#include "temp_hum.h"


extern void Temp_Hum_Test(void);


void SysTick_Handler(void)
{

}



int main(void)
{
  SystemInit();

  GPIOInit();						// Enables clock for GPIO

  //CLKOUT_Setup(CLKOUTCLK_SRC_MAIN_CLK);
  LPC_IOCON->PIO0_1 &= ~0x07;	
  LPC_IOCON->PIO0_1 |= 0x01;		/* CLK OUT */

 
  /* Called for system library in core_cm0.h. */
  SysTick_Config(48000);
  
  SPI_IOConfig(0);
  SPI_Init(0, 8, 2);
  //NVIC_SetPriority(SSP0_IRQn, 1);
  OLED_Init_I();

  UARTInit(115200);
  NVIC_SetPriority(UART_IRQn, 2);

  printf("\r\n\r\nSensor");

  delay_ms(500);
  
  while(1)
  {
 	printf("\r\n\r\nTemperature & Humidity");
	Temp_Hum_Test();
  }
}
 

/**** End of File ****/
